//Ext.QuickTips.init();



		/*var dataArr = [{
				code : '1',
				text : '第1层1'
			}, {
				code : '2',
				text : '第1层2'
			}, {
				code : '1.1',
				text : '第2层1'
			}, {
				code : '1.2',
				text : '第2层2'
			}, {
				code : '1.3',
				text : '第2层3'
			}, {
				code : '1.4',
				text : '第2层4'
			}, {
				code : '1.2.1',
				text : '第3层1'
			}];*/

	var treeMenuPanel = new Ext.tree.TreePanel({
				//useArrows : true,
				//autoScroll : true,
				//animate : true,
				//collapsible : true,
				//containerScroll : true,
				//frame : true,
				//width : 200,
				//height : 400,
				//renderTo : document.body,
				//autoHeight : true,
				border : false,
				rootVisible:false,
				root : new Ext.tree.TreeNode({
							// id:'root',
							text : '根节点',
							expanded : true,
							draggable : false
						}),
				loadCustomData : function(menuData) {
					this.root.removeAll();
					for (var i = 0; i < menuData.length; i++) {
						var obj = menuData[i];
						var path = obj.code.toString();
						var parentNode = null;
						var node = new Ext.tree.TreeNode({
									text : obj.name,
									code : path,
									link : obj.link,
									draggable : false
								});

						parentNode = this.root;
						if (!Ext.isEmpty(path)) {
							var parentCodeArray = [];
							parentCodeArray = mysplit(path,'.');
							var myparent = null;
							for(var a=0; a < parentCodeArray.length; a++){
								myparent  = parentNode.findChild('code',parentCodeArray[a]);
								if(myparent != null){
									parentNode = myparent;
								}
							}
						}
						parentNode.appendChild(node);
					}
				},
				listeners : {
					click : function(node,e){
						var centerP = Ext.getCmp('centerPanel');
						if(node.attributes.link){
							centerP.removeAll(true);
							centerP.setTitle(node.text);
							centerP.load({
								url : node.attributes.link,
								scripts : true
							});
						}else{
							alert('此功能暂时无法使用!');
						}
					}
				}
			});
			
			function mysplit(str,flag){
				var array = [];
				var num = 0;
				var index = str.indexOf(flag);
				while(index > -1){
					array.push(str.substr(0,index));
					num = index+1;
					index = str.indexOf(flag,num);
				}
				return array;
			};
